<pre>  /**
   * The constants used in this Content Widget.
   */
  public static interface CwConstants extends Constants {
    String cwFileUploadButton();

    String cwFileUploadDescription();

    String cwFileUploadName();

    String cwFileUploadNoFileError();

    String cwFileUploadSelectFile();

    String cwFileUploadSuccessful();
  }

  /**
   * An instance of the constants.
   */
  private final CwConstants constants;

  /**
   * Initialize this example.
   */
  @Override
  public Widget onInitialize() {
    // Create a vertical panel to align the content
    VerticalPanel vPanel = new VerticalPanel();

    // Add a label
    vPanel.add(new HTML(constants.cwFileUploadSelectFile()));

    // Add a file upload widget
    final FileUpload fileUpload = new FileUpload();
    fileUpload.ensureDebugId("cwFileUpload");
    vPanel.add(fileUpload);

    // Add a button to upload the file
    Button uploadButton = new Button(constants.cwFileUploadButton());
    uploadButton.addClickHandler(new ClickHandler() {
      public void onClick(ClickEvent event) {
        String filename = fileUpload.getFilename();
        if (filename.length() == 0) {
          Window.alert(constants.cwFileUploadNoFileError());
        } else {
          Window.alert(constants.cwFileUploadSuccessful());
        }
      }
    });
    vPanel.add(new HTML("&lt;br&gt;"));
    vPanel.add(uploadButton);

    // Return the layout panel
    return vPanel;
  }

</pre>